package com.service;

import java.util.ArrayList;
import java.util.List;

public class Company {

    private String name;

    private List<Employee> employees = new ArrayList<>();

    private  List<Manager> managers = new ArrayList<>();

    @Override
    public String toString() {

        StringBuffer buf = new StringBuffer();

        for (Manager manager :managers){
            //直接后接上对象会自动调用toString();函数
            buf.append(managers).append("\n");

        }
        for (Employee employee :employees){
            //直接后接上对象会自动调用toString();函数
            buf.append(employee).append("\n");

        }

        return buf.toString();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Employee> getEmployees() {
        return employees;
    }

    public void setEmployees(List<Employee> employees) {
        this.employees = employees;
    }

    public List<Manager> getManagers() {
        return managers;
    }

    public void setManagers(List<Manager> managers) {
        this.managers = managers;
    }
}
